Lesson 5 - If statements quiz
Quiz
What is selection?
- A way of testing values and then performing actions based on the result.
- Way of selecting people to code stuff
- A way of repeating code
What does the following evaluate to?
43 > 12
- True
- False
What does the following evaluate to?
43 == 12
- True
- False
What does the following evaluate to?
43 != 12
- True
- False
What does the following evaluate to?
43 > 12 * 4
- True
- False
What will be outputted?
x = 21
if x > 10
print "cookie"
else:
print "cake"
print "pie"
- cookie
- cake
- pie
- cookie
pie - cake
pie
What will be outputted?
x = 21
if x == 21
print "cookie"
else:
print "cake"
print "pie"
- cookie
- cake
- pie
- cookie
pie - cake
pie
Which of the following is NOT a conditional operator
- >
- =
- <
- !=